﻿<%@ control language="C#" autoeventwireup="true" inherits="UserControls_GuiSMS, App_Web_3yxxjaol" %>
<style type="text/css">
    .auto-style1
    {
        text-align: left;
    }
    .auto-style3
    {
        text-align: left;
        height: auto;
    }
    </style>
    
    <form id="form2" runat="server">
    <div style="text-align: center">
                <table style="width: 100%; height: 768px;">
                    <tr>
                        <td class="auto-style1" colspan="3">Xem theo:
        <asp:TextBox ID="TextBox1" runat="server" Visible="False"></asp:TextBox>
        <br />
        Khoa:
        <asp:DropDownList ID="ddlKhoa" runat="server" AutoPostBack="True" DataSourceID="GetKhoaSqlDataSource" DataTextField="TenKhoa" DataValueField="MaKH" OnSelectedIndexChanged="ddlKhoa_SelectedIndexChanged">
        </asp:DropDownList>
                            <asp:Label ID="Label1" runat="server"></asp:Label>
        <br />
        Lớp:
        <asp:DropDownList ID="ddlLop" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlLop_SelectedIndexChanged">
        </asp:DropDownList>
                        </td>
                        <td class="auto-style5" style="width: 100px">
                            <asp:Button ID="Button11" runat="server" OnClick="Button11_Click" Text="Soạn tin nhắn" />
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style1" style="top: 0px; vertical-align: top;">
        <asp:ListBox ID="lstSV" runat="server" Height="267px" Width="226px" SelectionMode="Multiple"></asp:ListBox>
                        </td>
                        <td style="vertical-align: top">
                    <asp:Button ID="Button9" runat="server" style="width: 22px" Text="&gt;" OnClick="Button9_Click" />
                    <br />
                    <br />
                    <br />
                    <asp:Button ID="Button10" runat="server" Text="&gt;&gt;" OnClick="Button10_Click1" />
                    <br />
                    <br />
                    <br />
                    <asp:Button ID="Button3" runat="server" Text="Xóa" OnClick="Button3_Click1" />
                    <br />
                    <br />
                    <br />
                    <asp:Button ID="Button4" runat="server" Text="Xóa hết" OnClick="Button4_Click" />
                        </td>
                        <td colspan="2" style="vertical-align: top">
                    <asp:GridView ID="GridView1" runat="server" EmptyDataText="Không có bản ghi nào" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SMSWebDataSource" EnableModelValidation="True" ForeColor="Black" GridLines="Vertical" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" PageSize="20" Width="462px" DataKeyNames="tempID">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="tempID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="tempID" />
                            <asp:BoundField DataField="MaND" HeaderText="MaND" SortExpression="MaND" Visible="False">
                            </asp:BoundField>
                            <asp:BoundField DataField="MaSV" HeaderText="Mã SV" SortExpression="MaSV" />
                            <asp:BoundField DataField="HoTenSV" HeaderText="Họ tên" SortExpression="HoTenSV" />
                            <asp:BoundField DataField="SoDT" HeaderText="Điện thoại" SortExpression="SoDT" />
                        <asp:TemplateField >
                            <ItemTemplate>
                                <asp:CheckBox ID="myCheckBox" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#CCCC99" />
                        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                        <PagerSettings Mode="NumericFirstLast" Position="TopAndBottom" />
                        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                        <RowStyle BackColor="#F7F7DE" />
                        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                    </asp:GridView>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style1">&nbsp;</td>
                        <td>&nbsp;</td>
                        <td colspan="2">&nbsp;</td>
                    </tr>
        </table>
                    <asp:SqlDataSource ID="SMSWebDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:SMSWebConnectionString %>" SelectCommand="SELECT * FROM [tbl_1_ChonNguoiNhan] WHERE ([MaND] = @MaND)" ConflictDetection="CompareAllValues" DeleteCommand="DELETE FROM [tbl_1_ChonNguoiNhan] WHERE [tempID] = @original_tempID AND [MaND] = @original_MaND AND [MaSV] = @original_MaSV AND [SoDT] = @original_SoDT AND (([HoTenSV] = @original_HoTenSV) OR ([HoTenSV] IS NULL AND @original_HoTenSV IS NULL))" InsertCommand="INSERT INTO [tbl_1_ChonNguoiNhan] ([MaND], [MaSV], [SoDT], [HoTenSV]) VALUES (@MaND, @MaSV, @SoDT, @HoTenSV)" OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [tbl_1_ChonNguoiNhan] SET [MaND] = @MaND, [MaSV] = @MaSV, [SoDT] = @SoDT, [HoTenSV] = @HoTenSV WHERE [tempID] = @original_tempID AND [MaND] = @original_MaND AND [MaSV] = @original_MaSV AND [SoDT] = @original_SoDT AND (([HoTenSV] = @original_HoTenSV) OR ([HoTenSV] IS NULL AND @original_HoTenSV IS NULL))">
                        <DeleteParameters>
                            <asp:Parameter Name="original_tempID" Type="Int32" />
                            <asp:Parameter Name="original_MaND" Type="String" />
                            <asp:Parameter Name="original_MaSV" Type="String" />
                            <asp:Parameter Name="original_SoDT" Type="String" />
                            <asp:Parameter Name="original_HoTenSV" Type="String" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="MaND" Type="String" />
                            <asp:Parameter Name="MaSV" Type="String" />
                            <asp:Parameter Name="SoDT" Type="String" />
                            <asp:Parameter Name="HoTenSV" Type="String" />
                        </InsertParameters>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="TextBox1" Name="MaND" PropertyName="Text" Type="String" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="MaND" Type="String" />
                            <asp:Parameter Name="MaSV" Type="String" />
                            <asp:Parameter Name="SoDT" Type="String" />
                            <asp:Parameter Name="HoTenSV" Type="String" />
                            <asp:Parameter Name="original_tempID" Type="Int32" />
                            <asp:Parameter Name="original_MaND" Type="String" />
                            <asp:Parameter Name="original_MaSV" Type="String" />
                            <asp:Parameter Name="original_SoDT" Type="String" />
                            <asp:Parameter Name="original_HoTenSV" Type="String" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
        <asp:SqlDataSource ID="GetKhoaSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:dangkyhv_dangkyConnectionString %>" SelectCommand="SELECT [TenKhoa], [MaKH] FROM [Khoa]"></asp:SqlDataSource>
    
    
    </div>
    </form>
